<?php

interface IDatabaseEngine
{
	public function connect($holder, $masterIRI, $slaveIRI = null);
}

interface IDatabaseConnection
{

	public function registerTable($ident, $name);
	public function getTable($db, $name, $createMode);
	public function getDatabase($hholder, $masterIRI, $slaveIRI = null);
	public function getQueryLog();
}

interface IDatabase
{
	public function getQueryLog();
	public function getIRI();
	
	public function beginTransaction();
	public function commitTransaction();
	public function rollbackTransaction();
}

interface ISQLDatabase extends IDatabase
{
	public function prepare($statement, $offset = 0, $limit = 0);
	public function query($statement /*, ... */);
	public function queryArgs($statement, $args);
	public function queryPaginated($sql, $offset = 0, $limit = 25 /*, ... */);
	public function queryPaginatedArgs($sql, $params, $offset = 0, $limit = 25);
	public function getAll($statement);
	public function getOne($statement);
	public function getAssoc($statement);
	public function getRow($statement);
	public function getCol($statement);
	public function quote($string);
	public function insertId();
	public function now();
	public function insert($table, $values, $raw = false);
	public function registerTable($ident, $name);
	public function getTable($ident, $createMode = DBCREATE_NONE, $raw = false);
	public function dropTable($ident, $raw = false);
	public function getTableName($ident);
}

interface IDirectoryDatabase extends IDatabase
{
	public function getOne($dn, $filter /*, ... */);
	public function getSub($dn, $filter /*, ... */);
	public function add($dn, $entry);
	public function update($dn, $entry);
	public function delete($dn);
}

interface IDatabaseStatement
{
	
}

interface IRecordSet
{
	public function moveNext();
	public function getAssoc();
}
